package studentService

import (
	"log"
	"tools_go/infrastructure/mysql/mysqlService"
	"tools_go/repository/mysql/model"
)

func QueryById(id uint) *model.Student {
	var student model.Student
	ret := mysqlService.DB.First(&student, id)
	if err := ret.Error; err != nil {
		log.Println("查询数据出错", err.Error())
		return nil
	}
	return &student
}
